package com;

import java.util.HashMap;
import java.util.Map;

public class Test3 {//修改map集合中指定的数据
    public static void main(String[] args) {
        Map<String,String> m=new HashMap<>();
        m.put("1","张三");
        m.put("2","李四");
        m.put("3","麻子");
        m.put("4","王二");
        System.out.println("修改前");
        for(String s:m.keySet()){
            System.out.println(m.get(s));
        }
        System.out.println("=============================");
        System.out.println("修改后");
        m.put("3","狗蛋");
        for(String s:m.keySet()){
            System.out.println(m.get(s));
        }
    }
}
